headers = [
    "cortexm/cortexm.h",
    "cortexm/task.h",
    "cortexm/mpu.h",
    "cortexm/fault.h",
    "cortexm/task_table.h",
    "cortexm/util.h",
    "cortexm/cortexm.h",
    "cortexm/task_types.h",
    "usbd/adc.h",
    "usbd/cdc.h",
    "usbd/control.h",
    "usbd/hid.h",
    "usbd/types.h",
    "usbd/msc_scsi.h",
    "usbd/defines.h",
    "usbd/msc.h",
    "usbd/dfu.h",
    "usbd/msft.h",
    "device/uartfifo.h",
    "device/fifo.h",
    "device/drive_sdspi.h",
    "device/device_fifo.h",
    "device/urandom.h",
    "device/stream_ffifo.h",
    "device/led_pio.h",
    "device/drive_mcu_flash.h",
    "device/tty.h",
    "device/null.h",
    "device/drive_cfi.h",
    "device/switchboard.h",
    "device/drive_device.h",
    "device/led_pwm.h",
    "device/appfs.h",
    "device/microchip/sst25vf.h",
    "device/drive_ram.h",
    "device/i2s_ffifo.h",
    "device/usbfifo.h",
    "device/cfifo.h",
    "device/sys.h",
    "device/reset_tmr.h",
    "device/netif_eth.h",
    "device/auth.h",
    "device/drive_sdio.h",
    "device/full.h",
    "device/drive_mmc.h",
    "device/mem.h",
    "device/auth_flash.h",
    "device/zero.h",
    "device/ffifo.h",
    "device/devfifo.h",
    "device/random.h",
    "sos/ioctl.h",
    "sos/power.h",
    "sos/debug.h",
    "sos/symbols.h",
    "sos/boot/bootloader.h",
    "sos/boot/boot_debug.h",
    "sos/config.h",
    "sos/events.h",
    "sos/led.h",
    "sos/trace.h",
    "sos/link/types.h",
    "sos/link/transport_usb_vcp.h",
    "sos/link/commands.h",
    "sos/link/transport_usb.h",
    "sos/link/transport_usb_link_vcp.h",
    "sos/link/transport.h",
    "sos/link/transport_usb_dual_vcp.h",
    "sos/link/transport_usb_link.h",
    "sos/arch/delay_cm.h",
    "sos/arch/cmsis/core_cm7.h",
    "sos/arch/cmsis/core_cm4_simd.h",
    "sos/arch/cmsis/core_cm3.h",
    "sos/arch/cmsis/cmsis_compiler.h",
    "sos/arch/cmsis/core_cm4.h",
    "sos/arch/cmsis/core_cm0.h",
    "sos/arch/cmsis/arm_math.h",
    "sos/arch/cmsis/core_cmInstr.h",
    "sos/arch/cmsis/core_armv8mml.h",
    "sos/arch/cmsis/core_ca.h",
    "sos/arch/cmsis/core_cmFunc.h",
    "sos/arch/cmsis/core_cmSecureAccess.h",
    "sos/arch/cmsis/core_sc000.h",
    "sos/arch/cmsis/core_sc300.h",
    "sos/arch/cmsis/cmsis_gcc.h",
    "sos/arch/cmsis/core_cm23.h",
    "sos/arch/cmsis/core_cm33.h",
    "sos/arch/cmsis/core_cm0plus.h",
    "sos/arch/cmsis/core_armv8mbl.h",
    "sos/symbols/defines.h",
    "sos/symbols/table.h",
    "sos/process.h",
    "sos/api/crypt_api.h",
    "sos/api/wifi_api.h",
    "sos/api/sos_api.h",
    "sos/dev/adc.h",
    "sos/dev/pio.h",
    "sos/dev/uartfifo.h",
    "sos/dev/mci.h",
    "sos/dev/qei.h",
    "sos/dev/netif.h",
    "sos/dev/fifo.h",
    "sos/dev/eint.h",
    "sos/dev/eeprom.h",
    "sos/dev/dac.h",
    "sos/dev/core.h",
    "sos/dev/device_fifo.h",
    "sos/dev/stream_ffifo.h",
    "sos/dev/tty.h",
    "sos/dev/pwm.h",
    "sos/dev/crc.h",
    "sos/dev/switchboard.h",
    "sos/dev/touch.h",
    "sos/dev/i2s.h",
    "sos/dev/mmc.h",
    "sos/dev/drive.h",
    "sos/dev/uart.h",
    "sos/dev/eth.h",
    "sos/dev/sdio.h",
    "sos/dev/display.h",
    "sos/dev/appfs.h",
    "sos/dev/emc.h",
    "sos/dev/led.h",
    "sos/dev/bootloader.h",
    "sos/dev/crypt.h",
    "sos/dev/radio.h",
    "sos/dev/i2s_ffifo.h",
    "sos/dev/button.h",
    "sos/dev/usbfifo.h",
    "sos/dev/rtc.h",
    "sos/dev/cfifo.h",
    "sos/dev/sys.h",
    "sos/dev/spi.h",
    "sos/dev/usb.h",
    "sos/dev/flash.h",
    "sos/dev/auth.h",
    "sos/dev/ltdc.h",
    "sos/dev/tmr.h",
    "sos/dev/mem.h",
    "sos/dev/ffifo.h",
    "sos/dev/qspi.h",
    "sos/dev/hash.h",
    "sos/dev/devfifo.h",
    "sos/dev/random.h",
    "sos/dev/i2c.h",
    "sos/link.h",
    "sos/fs/types.h",
    "sos/fs/assetfs.h",
    "sos/fs/appfs.h",
    "sos/fs/sysfs.h",
    "sos/fs/drive_assetfs.h",
    "sos/fs/devfs.h",
    "sos/fs/sffs.h",
    "sos/sos.h",
    "sos/fs.h",
    "sos/arch.h",
    "mcu/adc.h",
    "mcu/pio.h",
    "mcu/mci.h",
    "mcu/dma.h",
    "mcu/qei.h",
    "mcu/eint.h",
    "mcu/eeprom.h",
    "mcu/dac.h",
    "mcu/core.h",
    "mcu/ohci.h",
    "mcu/mcu.h",
    "mcu/pwm.h",
    "mcu/crc.h",
    "mcu/i2s.h",
    "mcu/mmc.h",
    "mcu/can.h",
    "mcu/rng.h",
    "mcu/uart.h",
    "mcu/eth.h",
    "mcu/sdio.h",
    "mcu/emc.h",
    "mcu/crypt.h",
    "mcu/periph.h",
    "mcu/rtc.h",
    "mcu/spi.h",
    "mcu/usb.h",
    "mcu/flash.h",
    "mcu/cfi.h",
    "mcu/ltdc.h",
    "mcu/tmr.h",
    "mcu/qspi.h",
    "mcu/hash.h",
    "mcu/wdt.h",
    "mcu/i2c.h",
]

posix_headers = [
    "posix/semaphore.h",
    "posix/aio.h",
    "posix/mqueue.h",
    "posix/arpa/inet.h",
    "posix/netinet/in.h",
    "posix/sys/ioctl.h",
    "posix/sys/dirent.h",
    "posix/sys/termios.h",
    "posix/sys/socket.h",
    "posix/sys/select.h",
    "posix/trace.h",
    "posix/netdb.h",
]

cxx_library(
    name = "sos_posix",
    visibility = ["PUBLIC"],
    header_namespace = "",
    exported_headers = {
        "semaphore.h": "posix/semaphore.h",
        "aio.h": "posix/aio.h",
        "mqueue.h": "posix/mqueue.h",
        "arpa/inet.h": "posix/arpa/inet.h",
        "netinet/in.h": "posix/netinet/in.h",
        "sys/ioctl.h": "posix/sys/ioctl.h",
        "sys/dirent.h": "posix/sys/dirent.h",
        "sys/termios.h": "posix/sys/termios.h",
        "sys/socket.h": "posix/sys/socket.h",
        "sys/select.h": "posix/sys/select.h",
        "trace.h": "posix/trace.h",
        "netdb.h": "posix/netdb.h",
    },
    exported_deps = [
        "SDK//:sdk",
    ],
)

cxx_library(
    name = "sos_include",
    visibility = ["PUBLIC"],
    header_namespace = "",
    exported_headers = headers,
    exported_deps = [
        ":sos_posix",
        "SDK//:sdk",
    ],
)
